#include "system.h"
#include "uart4Host.h"

rt_mailbox_t attackCmd_mailBoxHandler  = RT_NULL;

void sysInit(void)
{
    rt_kprintf("begin system init!\n");
    
    for(int _i = 0; _i <1000; _i ++)        // 等待几个毫秒
        for (int _j = 0; _j < 10000; _j++);
    
    WT931_9AxisData * IMU = IMU_Init();
    
    rt_kprintf("IMU init finish\n");
    
    DCMotor_Init();
    rt_kprintf("motor init finish\n");
    
    thread_sample_Init(IMU);
    thread_balance_Init(IMU);
    
    thread_yunTai_Init();
    attackCmd_mailBoxHandler = thread_Attack_Init();
    uart4HostInit();
    
    rt_kprintf("whole system init success!\n");
}

INIT_ENV_EXPORT(sysInit);
